package cn.shyouchi.wuguanjia.android.ui.event.post;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;

/**
 * Created by Eenie on 2016/11/17 at 16:08
 * Email: 472279981@qq.com
 * Des:
 */

public class EventPostAdapter extends BaseQuickAdapter<PostEntity.ResultMessageBean,BaseViewHolder> {

    EventPostContract.View mView;

    public EventPostAdapter(List<PostEntity.ResultMessageBean> data, EventPostContract.View view) {

        super(R.layout.item_event_post_layout, data);
        this.mView = view;

    }

    @Override
    protected void convert(BaseViewHolder holder, final PostEntity.ResultMessageBean bean) {
        holder.setText(R.id.tv_post_name, bean.getPost());
        holder.setText(R.id.tv_post_content, bean.getJobassignment());



        holder.getView(R.id.btn_del).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mView.onDelClick(bean);
            }
        });

        holder.getView(R.id.item_layout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mView.onItemClick(bean);
            }
        });

    }
}
